﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Resto.CostControl.Core.Cache;
using Resto.CostControl.Core.Facade.SiteModule.DataTransferObject;
using Resto.CostControl.Core.Enums;

namespace Resto.CostControl.Core.Query.DishDeliveryModule.ViewObject
{
    /// <summary>
    /// 菜肴发货单
    /// </summary>
    [Serializable]
    public class DishDeliveryVO
    {
        #region 基本属性

        /// <summary>
        /// 项目点
        /// </summary>
        public string SiteID { get; set; }

        /// <summary>
        /// 项目点名称
        /// </summary>
        public string SiteName
        {
            get
            {
                SiteDTO site = SiteDTOCache.Get(SiteID);
                if (site != null)
                    return site.Name;

                return string.Empty;
            }
        }

        /// <summary>
        /// 收货地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 发货单编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 发货单ID
        /// </summary>
        public string DeliveryID { get; set; }

        /// <summary>
        /// 发货日期
        /// </summary>
        public DateTime Date { get; set; }

        /// <summary>
        /// 发货单状态
        /// </summary>
        internal string StateCode { get; set; }

        public DishDeliveryState State
        {
            get
            {
                return (DishDeliveryState)Enum.Parse(typeof(DishDeliveryState), StateCode);
            }
        }

        #endregion


    }
}
